package com.sylar.happygps;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class RoadBendEditActivity extends Activity implements OnClickListener {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		setContentView(R.layout.roadbendedit);

		Button btn_title_left = (Button) findViewById(R.id.btn_title_left);
		btn_title_left.setVisibility(View.VISIBLE);
		btn_title_left.setText(R.string.app_name);
		btn_title_left.setOnClickListener(this);

		Button btn_help = (Button) findViewById(R.id.btn_help);
		btn_help.setVisibility(View.VISIBLE);
		btn_help.setOnClickListener(this);

		TextView tv_title_name = (TextView) findViewById(R.id.tv_title_name);
		tv_title_name.setVisibility(View.VISIBLE);
		tv_title_name.setText("正向路口转弯信息");
		
		
		View layout_road_run_delay = findViewById(R.id.layout_road_run_delay);
		layout_road_run_delay.setOnClickListener(this);
		View layout_road_run_time = findViewById(R.id.layout_road_run_time);
		layout_road_run_time.setOnClickListener(this);
		View layout_road_run_other = findViewById(R.id.layout_road_run_other);
		layout_road_run_other.setOnClickListener(this);
		View layout_road_play = findViewById(R.id.layout_road_play);
		layout_road_play.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.btn_title_left:
			finish();
			break;
		case R.id.btn_help:

			break;
		case R.id.layout_road_run_delay:
			showRoadDelay();
			break;
		case R.id.layout_road_run_time:
			showRoadTime();
			break;
		case R.id.layout_road_run_other:
			showRoadRunType();
			break;
		case R.id.layout_road_play:
			showRoadPlay();
			break;
		default:
			break;
		}
	}
	
	private void showRoadRunType(){
		new AlertDialog.Builder(this)
		.setItems(new String[]{"直行","左转","右转","调头","直行或左转","直行或右转","右行或左转","左转或调头","左转或调头","按其它提示行驶","景点道路","高速或快速路的连接线(入口)","高速或快速路的连接线(出口)","其它道路"},
			new DialogInterface.OnClickListener() {
			
			@Override
			public void onClick(DialogInterface dialog, int which) {
				dialog.dismiss();
			}
		})
		.setTitle("选择类型")
		.create().show();
	}
	
	
	private void showRoadTime(){
		new AlertDialog.Builder(this)
		.setItems(new String[]{"10秒","15秒","20秒","25秒","30秒","40秒","50秒","60秒","70秒","80秒","90秒","100秒","110秒","2分钟","3分钟","3分半钟","4分钟"},
			new DialogInterface.OnClickListener() {
			
			@Override
			public void onClick(DialogInterface dialog, int which) {
				dialog.dismiss();
			}
		})
		.setTitle("选择类型")
		.create().show();
	}
	
	private void showRoadDelay(){
		new AlertDialog.Builder(this)
		.setItems(new String[]{"10米","15米","20米","25米","30米","40米","50米","60米","70米","80米","90米","100米","110米","120米","150米","200米","250米","300米","400米","500米","600米","700米","800米","1000米"},
			new DialogInterface.OnClickListener() {
			
			@Override
			public void onClick(DialogInterface dialog, int which) {
				dialog.dismiss();
			}
		})
		.setTitle("选择类型")
		.create().show();
	}
	
	private void showRoadPlay(){
		new AlertDialog.Builder(this)
		.setItems(new String[]{"仅导航时播放","仅导游时播放","导航及导游时均播放"},
			new DialogInterface.OnClickListener() {
			
			@Override
			public void onClick(DialogInterface dialog, int which) {
				dialog.dismiss();
			}
		})
		.setTitle("选择类型")
		.create().show();
	}
}
